package com.alibaba.nacos.example.spring.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.nacos.example.spring.cloud.service.MenuTypeService;
import com.alibaba.nacos.example.spring.cloud.util.Result;

@RestController
@RequestMapping("menutype")
public class MenuTypeController {
	private final MenuTypeService menutypeService;
	
    @Autowired
    public MenuTypeController(MenuTypeService menutypeService) {
    	this.menutypeService = menutypeService;
    }
    /**
     * @param 根据id查询菜单类型
     * @param http://localhost/menutype/findMenuTypeById?menu_type_id=87040034426781701
     * @param menu_type_id
     * @throws Exception
     */
    @ResponseBody
    @GetMapping("/findMenuTypeById")
    public Result findMenuTypeById(@RequestParam String menu_type_id) throws Exception {
        return new Result(200, "成功", menutypeService.findMenuTypeById(menu_type_id));
    }
}
